home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / language / a65.ntxt next >
Text File  |  1995-04-22  |  53KB  |  2,852 lines

  1. 23-Jun-89 23:50:44-PDT,7575;000000000000
  2. Return-Path: <info-atari8-request@score.stanford.edu>
  3. Received: from ucbvax.Berkeley.EDU by SCORE.STANFORD.EDU with TCP; Fri 23 Jun 89 23:50:43-PDT
  4. Received: by ucbvax.Berkeley.EDU (5.61/1.37)
  5.     id AA21818; Fri, 23 Jun 89 23:46:33 -0700
  6. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7.     for atari8-programs@score.stanford.edu (info-atari8@score.stanford.edu)
  8.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9. Date: 24 Jun 89 05:40:40 GMT
  10. From: killer!chasm@ames.arc.nasa.gov  (Charles Marslett)
  11. Organization: The Unix(R) Connection, Dallas, Texas
  12. Subject: An Atari Assembler: A65
  13. Message-Id: <8448@killer.DALLAS.TX.US>
  14. Sender: info-atari8-request@score.stanford.edu
  15. To: info-atari8@score.stanford.edu
  16.  
  17. #    This is a shell archive (Part 2 of 3)
  18. #
  19. #    It contains the documentation (what little there is)
  20. #    for the A65 (NON-macro) assembler.
  21. #
  22. #----cut here-----cut here-----cut here-----cut here----#
  23. #!/bin/sh
  24. # shar:   Shell Archiver
  25. #    Run the following text with /bin/sh to create:
  26. #    a65.doc
  27. # This archive created: Fri Jun 23 20:31:09 1989
  28. sed 's/^X//' << \SHAR_EOF > a65.doc
  29. X
  30. X
  31. X                    A65 (A very simple 6502 assembler)
  32. X
  33. X                                   by
  34. X                             Charles Marslett
  35. X                             Wordmark Systems
  36. X
  37. X
  38. XThe A65 assembler is modeled after the Atari MACRO Assembler (AMAC) that
  39. Xwas distributed by APX along with the MEDIT editor and the DDT debugger.
  40. XThe most significant thing about it is that the source files cannot contain
  41. Xline numbers (so editors that use line numbers must be able to write an
  42. Xunnumbered output file).  A second characteristic is that it is a disk-to-
  43. Xdisk assembler (the source must be in a disk (or cassette) file and the
  44. Xobject cannot be inserted directly into memory.
  45. X
  46. XThe assembler is run from the DOS menu using the 'L' command, and prompts
  47. Xyou for the source file name, the object file name and the listing file
  48. Xname:  a RETURN in response to the object and listing prompts will cause
  49. Xthe assembler to generate files on the same drive with extensions '.OBJ'
  50. Xand '.LST' using the same file name as the source file.  If no '.' appears
  51. Xin the source file name, '.ASM' is its assumed extension.  A listing can
  52. Xbe printed directly by specifying 'P:' as the list file or dumped to the
  53. Xscreen by specifying 'E:'.  A '-' disables the listing if you do not want
  54. Xone.
  55. X
  56. XA start at implementing support for the 65C02 opcodes is in the code, but
  57. Xwhat is there has not been tested very thouroughly and most of the opcodes
  58. Xand addressing modes are not in place yet.  Otherwise, the machine
  59. Xinstructions are as any other standard 6502 assembler would expect.
  60. XExpressions can include +, -, * and / operators as well as HIGH[] and LOW[]
  61. Xfunctions to extract the high and low bytes of 16-bit numbers.  Brackets,
  62. X[ and ], may be used to group terms in an expression if necessary.  Symbols
  63. Xmay have up to 11 characters, including upper and lower case letters,
  64. Xunderscores and numbers.  Symbols must start with an underscore or letter,
  65. Xand case is significant except for the predefined assembler opcodes and the
  66. Xregister names A, X and Y.
  67. X
  68. XThe machine opcodes recognized are:
  69. X
  70. X   ADC, AND, ASL, BCC, BCS, BEQ, BIT, BMI, BNE, BPL, BRA (65C02 only),
  71. X   BRK, BVC, BVS, CLC, CLD, CLI, CLV, CMP, CPX, CPY, DEC, DEX, DEY,
  72. X   EOR, INC, INX, INY, JMP, JSR, LDA, LDX, LDY, LSR, NOP, ORA, PHA,
  73. X   PHP, PLA, PLP, ROL, ROR, RTI, RTS, SBC, SEC, SED, SEI, STA, STX,
  74. X   STY, TAX, TAY, TSX, TXA, TXS, TYA
  75. X
  76. XThe assembler directives are:
  77. X
  78. XDB      defines a byte, in decimal (12), hex ($0C), octal (@14) or binary
  79. X        (%00001100) and may also be a character string (enclosed in quotes)
  80. XDC      defines a byte, as above, but with the high bit set (if defining a
  81. X        string, only on the last byte of the string)
  82. XDW      defines a word, low byte first, as if an indirect pointer
  83. XDS      allocates a number of bytes without storing any data in them
  84. X
  85. XORG     sets the location counter to a fixed address
  86. X*=      same as ORG
  87. XEQU     defines a symbol to have a specific value
  88. X=       same as EQU
  89. X
  90. X
  91. X
  92. X
  93. X
  94. X
  95. X
  96. X
  97. XINCLUDE causes the file specified to be inserted at this point in the
  98. X        assembly (can be nested if the DOS supports sufficient numbers
  99. X        of files open at once -- the object, list and source files are
  100. X        kept open at all times, and each level of nested includes requires
  101. X        one more open file.  MYDOS and Atari DOS 2 allow 3 normally, which
  102. X        does not allow a listing and include files.  If set to 5, the
  103. X        assembler could generate a listing and handle 1 level of nested
  104. X        includes)
  105. XTITLE   specifies the first title line
  106. XSUBTTL  allows entering a second title line
  107. XPAGE    causes the assembler to go to the top of th next listing page
  108. X
  109. XEND     terminates the program and specifies INIT and RUN addresses
  110. X
  111. XLIST    a stub for future expansion
  112. XMACRO   another stub (does nothing, not even generate an error)
  113. XMEND    another stub
  114. X
  115. XOctal numbers, EQU, *=, and INIT and RUN addresses may have bugs in them --
  116. Xgood luck.  Most of the rest has been debugged reasonably well.
  117. X
  118. XThe END statement can have the following forms:
  119. X
  120. X        END             no RUN or INIT vectors generated at all
  121. X        END  ADDR       ADDR is the RUN entry point
  122. X        END  ADDR,      ADDR is the INIT entry point (no RUN vector)
  123. X        END  INIT,RUN   both vectors specified
  124. X
  125. X(This is what I call minimum documentation, I will add to it as questions
  126. Xare asked)
  127. X
  128. X                        Charles Marslett
  129. X                        8/21/85
  130. X
  131. X
  132. X
  133. XChanges since the first release:
  134. X
  135. XThe assembler now behaves more reasonably when a forward reference is
  136. Xencountered (it used to just generate junque quietly!) -- forward references
  137. Xare forced to 16-bit values if possible, otherwise A65 assumes you know what
  138. Xyou are doing, and assumes it will be an 8-bit value when it is defined.
  139. X
  140. XThe assembler allows upper and lower case symbols, and it is case sensitive.
  141. XIt still ignores case, however, when handling the directives and machine
  142. Xopcodes as well as the register names ("A", "X" and "Y").  Underscores are
  143. Xalso allow in symbols and are treated as letters (makes C people happy!).
  144. XSymbols may also be up to 11 characters long (rather than 8 as before).
  145. X
  146. XThe initial load address is the HIMEM value from DOS (the lowest possible
  147. Xload address) rather than a random value left over in memory.
  148. X
  149. XErrors are marked in the listing file (as before) but they are also echoed
  150. Xto the screen, and the total number of errors (in HEX) are reported at the
  151. Xend of the assembly.  If any errors occur, the automatic return to the DOS
  152. Xprompt is delayed until the [RETURN] key is pressed to give you an opportunity
  153. Xto note any (unexpected) errors reported.
  154. X
  155. X
  156. X
  157. X
  158. X
  159. X
  160. X
  161. X
  162. X
  163. XFinally, some errors that were previously accepted (and generated bad code)
  164. Xare now caught and flagged as errors). These included multiply defined
  165. Xsymbols and some invalid addressing modes.
  166. X
  167. X                        Charles Marslett
  168. X                        6/16/89
  169. SHAR_EOF
  170. #    End of shell archive
  171. exit 0
  172. ===========================================================================
  173. Charles Marslett
  174. STB Systems, Inc.  <== Apply all standard disclaimers
  175. Wordmark Systems   <== No disclaimers required -- that's just me
  176. chasm@killer.dallas.tx.us
  177. 23-Jun-89 23:50:48-PDT,8139;000000000000
  178. Return-Path: <info-atari8-request@score.stanford.edu>
  179. Received: from ucbvax.Berkeley.EDU by SCORE.STANFORD.EDU with TCP; Fri 23 Jun 89 23:50:47-PDT
  180. Received: by ucbvax.Berkeley.EDU (5.61/1.37)
  181.     id AA21825; Fri, 23 Jun 89 23:46:43 -0700
  182. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  183.     for atari8-programs@score.stanford.edu (info-atari8@score.stanford.edu)
  184.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  185. Date: 24 Jun 89 05:42:26 GMT
  186. From: killer!chasm@ames.arc.nasa.gov  (Charles Marslett)
  187. Organization: The Unix(R) Connection, Dallas, Texas
  188. Subject: An Atari Assembler: A65
  189. Message-Id: <8449@killer.DALLAS.TX.US>
  190. Sender: info-atari8-request@score.stanford.edu
  191. To: info-atari8@score.stan